#include "comm.hpp"
#include "shm.hpp"
int main()
{

    NamePipe np(PATH,FIFO_FILE);
    FileOperator fo(PATH,FIFO_FILE);
    Shm s(CREATE,PathName,Proj_id);

    s.Attr();
    //读
    fo.OpenFileForRead();
    char *mem = (char *)s.VirtualAddress();
    while(true)
    {
        // fo.Read();
        // sleep(1);
        if(fo.Wait())
        {
            std::cout<<mem<<std::endl;
        }
        else break;
    }

    // s.VirtualAddress();
    fo.Close();
    // s.~Shm();
    return 0;
}